package org.diysearch.models;

import java.util.ArrayList;
import java.util.List;

import org.apache.solr.client.solrj.beans.Field;
import org.diysearch.interfaces.Model;

public class Category extends BaseModel implements Model {

	private int id;
	
	@Field("cat")
	private String name;
	private int parentId;
	
	/**
	 * We are limiting the category tree to ONLY two levels, and beyond that
	 * users will tag links with their own categorization. 
	 */
	private List<Category> children;
	
	public Category() {
		children = new ArrayList<Category>();
	}
	
	public List<Category> getChildren() {
		return children;
	}

	public void setChildren(List<Category> children) {
		this.children = children;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	@Override
	public String getAliasName() {
		return "category";
	}

}
